﻿namespace CodingExercises._21_30;

public class Pair<T>
{
    // 泛型匹配类型
    public T First { get; private set; }
    public T Second { get; private set; }

    public Pair(T first, T second)
    {
        First = first;
        Second = second;
    }

    public void Swap()
    {
        T tmp = First;
        First = Second;
        Second = tmp;
    }
}